<!DOCTYPE html>
<head>
	<% content_for :title, t("LoginPage") %>
	<%= stylesheet_link_tag "style" %>
</head>

<body id = "login-page">
	<div class="feat_prod_box_details">
		<div class="contact_form">
			<div class="form_subtitle">
				<%= t :logintitle %>
			</div>
			<div id = "loginForm" onsubmit="return checkLogin()">
				<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
				<div class="form_row">
						<strong class="contact"><%= f.label t("username") %></strong>
						<%= f.text_field :username , :html => {:class => "contact_input"} %>
				</div>

				<div class="form_row">
						<strong class="contact"><%= f.label t("password"), :html => {:class => "contact"} %></strong>
						<%= f.password_field :password , :html => {:class => "contact_input"} %>
				</div>

				<% if devise_mapping.rememberable? -%>
				<div class="form_row">
					<div class="terms">
						<%= f.check_box :remember_me %> <%= f.label t("rememberme") %>
					</div>
				</div>
				<% end -%>

				<div class="form_row">
					<input type="submit" class="register" value="<%= t :login %>" />
				</div>
				<br/>
				<br/>
				<div>
					<%= render "devise/shared/links" %>
				</div>
				<% end %>
			</div>
		</div>
	</div>
	<script>
		function checkLogin() {
			var x = document.getElementById("user_username").value;
			if (x == "") {
				alert("<%= t :usernamefilled %>");
				return false;
			}

			var y = document.getElementById("user_password").value;
			if (y.length < 1) {
				alert("<%= t :passwordfilledout %>");
				return false;
			}
		}
	</script>
</body>
</html>
